import { lazy, Suspense } from 'react';
import { Routes, Route } from "react-router-dom";

const Home=lazy(()=>import('./views/Home/index'));
const Login=lazy(()=>import('./views/Login/index'));
const Mine=lazy(()=>import('./views/Mine/index'));
const Upload=lazy(()=>import('./views/Upload/index'));
const Editor=lazy(()=>import('./views/Editor/index'));

const App=()=>{
  return (
    <Suspense fallback={<div>Loading...</div>}>
      <Routes>
        <Route path="/" element={<Home />} />
        <Route path="/home" element={<Home />} />
        <Route path="/login" element={<Login />} />
        <Route path="/mine" element={<Mine />} />
        <Route path="/upload" element={<Upload />} />
        <Route path="/editor" element={<Editor />} />
      </Routes>
    </Suspense>
  )
}
export default App